﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class PublicOfficialRecordModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        /// <summary>
        /// 0未审核，1已审核，2已退回,3暂存，4已有审核通过的岗位
        /// </summary>
        private int _GeRenStatus;
        [DataMember]
        public int GeRenStatus
        {
            get { return _GeRenStatus; }
            set { _GeRenStatus = value; }
        }
        private string _CheckState;
        [DataMember]
        public string CheckState
        {
            get { return _CheckState; }
            set { _CheckState = value; }
        }
        /// <summary>
        /// 整个职位的报名审核情况
        /// </summary>
        private bool _Status;
        [DataMember]
        public bool Status
        {
            get { return _Status; }
            set { _Status = value; }
        }

        private int _Status1;
        [DataMember]
        public int Status1
        {
            get { return _Status1; }
            set { _Status1 = value; }
        }

        private bool _IsZhuanRen;
        [DataMember]
        public bool IsZhuanRen
        {
            get { return _IsZhuanRen; }
            set { _IsZhuanRen = value; }
        }

        private int _EmpID;
        [DataMember]
        public int EmpID
        {
            get { return _EmpID; }
            set { _EmpID = value; }
        }
        private int _PublicOfficialRecordID;
        [DataMember]
        public int PublicOfficialRecordID
        {
            get { return _PublicOfficialRecordID; }
            set { _PublicOfficialRecordID = value; }
        }


        private int _PublicOfficialSelectionID;
        [DataMember]
        public int PublicOfficialSelectionID
        {
            get { return _PublicOfficialSelectionID; }
            set { _PublicOfficialSelectionID = value; }
        }

        private DateTime? _Date;
        [DataMember]
        public DateTime? Date
        {
            get { return _Date; }
            set { _Date = value; }
        }
        /// <summary>
        /// 单位
        /// </summary>
        private string _Unit;
        [DataMember]
        public string Unit
        {
            get { return _Unit; }
            set { _Unit = value; }
        }
        /// <summary>
        /// 科室
        /// </summary>
        private string _Department;
        [DataMember]
        public string Department
        {
            get { return _Department; }
            set { _Department = value; }
        }
        /// <summary>
        /// 职位
        /// </summary>
        private string _DutyAttribute;
        [DataMember]
        public string DutyAttribute
        {
            get { return _DutyAttribute; }
            set { _DutyAttribute = value; }
        }
        private string _Duty;
        [DataMember]
        public string Duty
        {
            get { return _Duty; }
            set { _Duty = value; }
        }
        /// <summary>
        /// 报名人数
        /// </summary>
        private string _BaoMingCount;
        [DataMember]
        public string BaoMingCount
        {
            get { return _BaoMingCount; }
            set { _BaoMingCount = value; }
        }
        /// <summary>
        /// 每个人报名的职位数量
        /// </summary>
        private string _BaoMingCount1 = string.Empty;
        [DataMember]
        public string BaoMingCount1
        {
            get { return _BaoMingCount1; }
            set { _BaoMingCount1 = value; }
        }
        /// <summary>
        /// 带审核数
        /// </summary>
        private string _DaiShenHeCount = string.Empty;
        [DataMember]
        public string DaiShenHeCount
        {
            get { return _DaiShenHeCount; }
            set { _DaiShenHeCount = value; }
        }
        /// <summary>
        /// 已审核数
        /// </summary>
        private string _YiShenHeCount=string.Empty;
        [DataMember]
        public string YiShenHeCount
        {
            get { return _YiShenHeCount; }
            set { _YiShenHeCount = value; }
        }
        /// <summary>
        /// 该职位已审核数
        /// </summary>
        private string _GaiYiShenHeCount = string.Empty;
        [DataMember]
        public string GaiYiShenHeCount
        {
            get { return _GaiYiShenHeCount; }
            set { _GaiYiShenHeCount = value; }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        private string _EmpName;
        [DataMember]
        public string EmpName
        {
            get { return _EmpName; }
            set { _EmpName = value; }
        }
        /// <summary>
        /// 证件号码
        /// </summary>
        private string _CardNo;
        [DataMember]
        public string CardNo
        {
            get { return _CardNo; }
            set { _CardNo = value; }
        }
        /// <summary>
        /// 现工作单位
        /// </summary>
        private string _NowUnit;
        [DataMember]
        public string NowUnit
        {
            get { return _NowUnit; }
            set { _NowUnit = value; }
        }
        /// <summary>
        /// 先工作职务
        /// </summary>
        private string _NowDuty;
        [DataMember]
        public string NowDuty
        {
            get { return _NowDuty; }
            set { _NowDuty = value; }
        }
        private string _CheckMemo;
        [DataMember]
        public string CheckMemo
        {
            get { return _CheckMemo; }
            set { _CheckMemo = value; }
        }
        private bool isselected = false;
        [DataMember]
        public bool IsSelected
        {
            get { return isselected; }
            set { isselected = value; }
        }
        private decimal? _BiShiScore = 0;
        [DataMember]
        public decimal? BiShiScore
        {
            get { return _BiShiScore; }
            set { _BiShiScore = value; }
        }
        private decimal? _MianShiScore = 0;
        [DataMember]
        public decimal? MianShiScore
        {
            get { return _MianShiScore; }
            set { _MianShiScore = value; }
        }
        private decimal? _TotalScore = 0;
        [DataMember]
        public decimal? TotalScore
        {
            get { return _TotalScore; }
            set { _TotalScore = value; }
        }

        private int? _XuQiuCount = 0;
        [DataMember]
        public int? XuQiuCount
        {
            get { return _XuQiuCount; }
            set { _XuQiuCount = value; }
        }

        private int? _NiTongYiCount = 0;
        [DataMember]
        public int? NiTongYiCount
        {
            get { return _NiTongYiCount; }
            set { _NiTongYiCount = value; }
        }

        private int? _MingCi = 0;
        [DataMember]
        public int? MingCi
        {
            get { return _MingCi; }
            set { _MingCi = value; }
        }
        private int? _OrgID = 0;
        [DataMember]
        public int? OrgID
        {
            get { return _OrgID; }
            set { _OrgID = value; }
        }

        private string _Zu;
        [DataMember]
        public string Zu
        {
            get { return _Zu; }
            set { _Zu = value; }
        }
        private string _MianShiRiQi;
        [DataMember]
        public string MianShiRiQi
        {
            get { return _MianShiRiQi; }
            set { _MianShiRiQi = value; }
        }
        private decimal? _BiShiFenZheSuan = 0;
        [DataMember]
        public decimal? BiShiFenZheSuan
        {
            get { return _BiShiFenZheSuan; }
            set { _BiShiFenZheSuan = value; }
        }
        private decimal? _MianShiFenZheSuan = 0;
        [DataMember]
        public decimal? MianShiFenZheSuan
        {
            get { return _MianShiFenZheSuan; }
            set { _MianShiFenZheSuan = value; }
        }

        /// <summary>
        /// 发布的时候看是发布的那种选拔类型的
        /// </summary>
        private string _FaBuType;
        [DataMember]
        public string FaBuType
        {
            get { return _FaBuType; }
            set { _FaBuType = value; }
        }
        private string _IsTongYi;
        [DataMember]
        public string IsTongYi
        {
            get { return _IsTongYi; }
            set { _IsTongYi = value; }
        }
        private string _OrgName;
        [DataMember]
        public string OrgName
        {
            get { return _OrgName; }
            set { _OrgName = value; }
        }
        private bool _IsLocked;
        [DataMember]
        public bool IsLocked
        {
            get { return _IsLocked; }
            set { _IsLocked = value; }
        }
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _ExameID;
        [DataMember]
        public int ExameID
        {
            get { return _ExameID; }
            set { _ExameID = value; }
        }
        private string _PositionName;
        [DataMember]
        public string PositionName
        {
            get { return _PositionName; }
            set { _PositionName = value; }
        }
        private string _DutyLevel;
        [DataMember]
        public string DutyLevel
        {
            get { return _DutyLevel; }
            set { _DutyLevel = value; }
        }
        private DateTime? _OKDate;
        [DataMember]
        public DateTime? OKDate
        {
            get { return _OKDate; }
            set { _OKDate = value; }
        }
        private string _Gender;
        [DataMember]
        public string Gender
        {
            get { return _Gender; }
            set { _Gender = value; }
        }
        private DateTime? _Birthday;
        [DataMember]
        public DateTime? Birthday
        {
            get { return _Birthday; }
            set { _Birthday = value; }
        }
        private string _Political;
        [DataMember]
        public string Political
        {
            get { return _Political; }
            set { _Political = value; }
        }
        private string _Native;
        [DataMember]
        public string Native
        {
            get { return _Native; }
            set { _Native = value; }
        }
        private string _ZhuanKeSchool;
        [DataMember]
        public string ZhuanKeSchool
        {
            get { return _ZhuanKeSchool; }
            set { _ZhuanKeSchool = value; }
        }
        private string _ZhuanKeProfessional;
        [DataMember]
        public string ZhuanKeProfessional
        {
            get { return _ZhuanKeProfessional; }
            set { _ZhuanKeProfessional = value; }
        }
        private string _BenKeSchool;
        [DataMember]
        public string BenKeSchool
        {
            get { return _BenKeSchool; }
            set { _BenKeSchool = value; }
        }
        private string _BenKeProfessional;
        [DataMember]
        public string BenKeProfessional
        {
            get { return _BenKeProfessional; }
            set { _BenKeProfessional = value; }
        }
        private string _ShuoShiSchool;
        [DataMember]
        public string ShuoShiSchool
        {
            get { return _ShuoShiSchool; }
            set { _ShuoShiSchool = value; }
        }
        private string _ShuoShiProfessional;
        [DataMember]
        public string ShuoShiProfessional
        {
            get { return _ShuoShiProfessional; }
            set { _ShuoShiProfessional = value; }
        }
        private string _BoShiSchool;
        [DataMember]
        public string BoShiSchool
        {
            get { return _BoShiSchool; }
            set { _BoShiSchool = value; }
        }
        private string _BoShiProfessional;
        [DataMember]
        public string BoShiProfessional
        {
            get { return _BoShiProfessional; }
            set { _BoShiProfessional = value; }
        }
        private string _TopEducationName;
        [DataMember]
        public string TopEducationName
        {
            get { return _TopEducationName; }
            set { _TopEducationName = value; }
        }
        private string _FullEducationBg;
        [DataMember]
        public string FullEducationBg
        {
            get { return _FullEducationBg; }
            set { _FullEducationBg = value; }
        }
        private string _FullDegree;
        [DataMember]
        public string FullDegree
        {
            get { return _FullDegree; }
            set { _FullDegree = value; }
        }
        private string _Phone;
        [DataMember]
        public string Phone
        {
            get { return _Phone; }
            set { _Phone = value; }
        }
        private string _Health;
        [DataMember]
        public string Health
        {
            get { return _Health; }
            set { _Health = value; }
        }
        private string _Marriage;
        [DataMember]
        public string Marriage
        {
            get { return _Marriage; }
            set { _Marriage = value; }
        }
        private string _HomeAddress;
        [DataMember]
        public string HomeAddress
        {
            get { return _HomeAddress; }
            set { _HomeAddress = value; }
        }
        private string _Email;
        [DataMember]
        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        private DateTime? _RiQi;
        [DataMember]
        public DateTime? RiQi
        {
            get { return _RiQi; }
            set { _RiQi = value; }
        }
        private string _Shi;
        [DataMember]
        public string Shi
        {
            get { return _Shi; }
            set { _Shi = value; }
        }

        /// <summary>
        /// 科室
        /// </summary>
        private string _Department_Duty;
        [DataMember]
        public string Department_Duty
        {
            get { return _Department_Duty; }
            set { _Department_Duty = value; }
        }
        /// <summary>
        /// 面试地址
        /// </summary>
        private string _MianShiDiZhi;
        [DataMember]
        public string MianShiDiZhi
        {
            get { return _MianShiDiZhi; }
            set { _MianShiDiZhi = value; }
        }
        /// <summary>
        /// 用于提取面试人员表的数据
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        public static PublicOfficialRecordModel FillEntity4(DataRow dr)
        {
            PublicOfficialRecordModel right = new PublicOfficialRecordModel();
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            right.Department = dr["Department"] as string;
            right.Duty = dr["Duty"] as string;
            right.EmpName = dr["EmpName"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("BiShiScore")) if (!string.IsNullOrEmpty(dr["BiShiScore"].ToString())) right.BiShiScore = Convert.ToDecimal(dr["BiShiScore"]);
            right.CardNo = dr["CardNo"] as string;
            right.OrgName = dr["OrgName"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("Department_Duty")) right.Department_Duty = dr["Department_Duty"] as string;
            right.PositionName = dr["PositionName"] as string;
            right.DutyLevel = dr["DutyLevel"] as string;
            if (!string.IsNullOrEmpty(dr["OKDate"].ToString())) right.OKDate = (DateTime?)dr["OKDate"];
            right.Gender = dr["Gender"] as string;
            if (!string.IsNullOrEmpty(dr["Birthday"].ToString())) right.Birthday = (DateTime?)dr["Birthday"];
            right.Political = dr["Political"] as string;
            right.Native = dr["Native"] as string;
            if (!string.IsNullOrEmpty(dr["ZhuanKeSchool"].ToString())) right.ZhuanKeSchool = (dr["ZhuanKeSchool"] as string).Split('-')[0];
            if (!string.IsNullOrEmpty(dr["ZhuanKeSchool"].ToString())) right.ZhuanKeProfessional = (dr["ZhuanKeSchool"] as string).Split('-')[1];
            if (!string.IsNullOrEmpty(dr["BenKeSchool"].ToString())) right.BenKeSchool = (dr["BenKeSchool"] as string).Split('-')[0];
            if (!string.IsNullOrEmpty(dr["BenKeSchool"].ToString())) right.BenKeProfessional = (dr["BenKeSchool"] as string).Split('-')[1];
            if (!string.IsNullOrEmpty(dr["ShuoShiSchool"].ToString())) right.ShuoShiSchool = (dr["ShuoShiSchool"] as string).Split('-')[0];
            if (!string.IsNullOrEmpty(dr["ShuoShiSchool"].ToString())) right.ShuoShiProfessional = (dr["ShuoShiSchool"] as string).Split('-')[1];
            if (!string.IsNullOrEmpty(dr["BoShiSchool"].ToString())) right.BoShiSchool = (dr["BoShiSchool"] as string).Split('-')[0];
            if (!string.IsNullOrEmpty(dr["BoShiSchool"].ToString())) right.BoShiProfessional = (dr["BoShiSchool"] as string).Split('-')[1];

            right.TopEducationName = dr["TopEducationName"] as string;
            right.FullEducationBg = dr["FullEducationBg"] as string;
            right.FullDegree = dr["FullDegree"] as string;
            right.Phone = dr["Phone"] as string;
            right.Health = dr["Health"] as string;
            right.Marriage = dr["Marriage"] as string;
            right.HomeAddress = dr["HomeAddress"] as string;
            right.Email = dr["Email"] as string;

            if (dr.Table != null && dr.Table.Columns.Contains("Zu")) right.Zu = dr["Zu"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("RiQi")) if (!string.IsNullOrEmpty(dr["RiQi"].ToString())) right.RiQi = (DateTime?)dr["RiQi"];
            if (dr.Table != null && dr.Table.Columns.Contains("Shi")) right.Shi = dr["Shi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("Department_Duty"))
                right.Department_Duty = dr["Department_Duty"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute"))
                right.DutyAttribute = dr["DutyAttribute"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("MianShiDiZhi"))
                right.MianShiDiZhi = dr["MianShiDiZhi"] as string;
            return right;
        }
        public static PublicOfficialRecordModel FillEntity(DataRow dr)
        {
            PublicOfficialRecordModel right = new PublicOfficialRecordModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ExameID")) if (!string.IsNullOrEmpty(dr["ExameID"].ToString())) right.ExameID = Convert.ToInt32(dr["ExameID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) if (!string.IsNullOrEmpty(dr["Sec"].ToString())) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ID")) if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = (int)dr["ID"];
            if (dr.Table != null && dr.Table.Columns.Contains("EmpID")) if (!string.IsNullOrEmpty(dr["EmpID"].ToString())) right.EmpID = Convert.ToInt32(dr["EmpID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Status1")) if (!string.IsNullOrEmpty(dr["Status1"].ToString())) right.Status1 =Convert.ToInt32(dr["Status1"]);
            if (dr.Table != null && dr.Table.Columns.Contains("GeRenStatus")) if (!string.IsNullOrEmpty(dr["GeRenStatus"].ToString())) right.GeRenStatus = Convert.ToInt32(dr["GeRenStatus"]);
            if (dr.Table != null && dr.Table.Columns.Contains("PublicOfficialSelectionID")) if (!string.IsNullOrEmpty(dr["PublicOfficialSelectionID"].ToString())) right.PublicOfficialSelectionID = Convert.ToInt32(dr["PublicOfficialSelectionID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Date")) if (!string.IsNullOrEmpty(dr["Date"].ToString())) right.Date = (DateTime?)dr["Date"];
            if (dr.Table != null && dr.Table.Columns.Contains("Unit")) right.Unit = dr["Unit"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("Department")) right.Department = dr["Department"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("Duty")) right.Duty = dr["Duty"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("PublicOfficialRecordID")) if (!string.IsNullOrEmpty(dr["PublicOfficialRecordID"].ToString())) right.PublicOfficialRecordID = Convert.ToInt32(dr["PublicOfficialRecordID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("BaoMingCount")) right.BaoMingCount = dr["BaoMingCount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("GaiYiShenHeCount")) right.GaiYiShenHeCount = dr["GaiYiShenHeCount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("BaoMingCount1")) right.BaoMingCount1 = dr["BaoMingCount1"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("DaiShenHeCount")) right.DaiShenHeCount = dr["DaiShenHeCount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("YiShenHeCount")) right.YiShenHeCount = dr["YiShenHeCount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("EmpName")) right.EmpName = dr["EmpName"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("CardNo")) right.CardNo = dr["CardNo"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("NowUnit")) right.NowUnit = dr["NowUnit"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("NowDuty")) right.NowDuty = dr["NowDuty"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("CheckMemo")) right.CheckMemo = dr["CheckMemo"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("FaBuType")) right.FaBuType = dr["FaBuType"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("IsTongYi")) right.IsTongYi = dr["IsTongYi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("IsLocked")) right.IsLocked = Convert.ToBoolean(dr["IsLocked"]);
            if (dr.Table != null && dr.Table.Columns.Contains("BiShiScore")) if (!string.IsNullOrEmpty(dr["BiShiScore"].ToString())) right.BiShiScore = Convert.ToDecimal(dr["BiShiScore"]);
            if (dr.Table != null && dr.Table.Columns.Contains("MianShiScore")) if (!string.IsNullOrEmpty(dr["MianShiScore"].ToString())) right.MianShiScore = Convert.ToDecimal(dr["MianShiScore"]);
            if (dr.Table != null && dr.Table.Columns.Contains("TotalScore")) if (!string.IsNullOrEmpty(dr["TotalScore"].ToString())) right.TotalScore = Convert.ToDecimal(dr["TotalScore"]);
            if (dr.Table != null && dr.Table.Columns.Contains("MingCi")) if (!string.IsNullOrEmpty(dr["MingCi"].ToString())) right.MingCi = Convert.ToInt32(dr["MingCi"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Department_Duty"))
                right.Department_Duty = dr["Department_Duty"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute"))
                right.DutyAttribute = dr["DutyAttribute"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("MianShiDiZhi"))
                right.MianShiDiZhi = dr["MianShiDiZhi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("IsZhuanRen")) if (!string.IsNullOrEmpty(dr["IsZhuanRen"].ToString())) right.IsZhuanRen = (bool)dr["IsZhuanRen"];
            if (dr.Table != null && dr.Table.Columns.Contains("GeRenStatus"))
            switch (right.GeRenStatus)
            {
                case 0:
                    right.CheckState = "未审核";
                    break;
                case 1:
                    right.CheckState = "已审核";
                    break;
                case 2:
                    right.CheckState = "已退回";
                    break;
                case 3:
                    right.CheckState = "暂存";
                    break;
                case 4:
                    right.CheckState = "已有报名岗位审核通过";
                    break;
            }
            return right;
        }

        public static PublicOfficialRecordModel FillEntity1(DataRow dr)
        {
            PublicOfficialRecordModel right = new PublicOfficialRecordModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ExameID")) if (!string.IsNullOrEmpty(dr["ExameID"].ToString())) right.ExameID = Convert.ToInt32(dr["ExameID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            right.ID = (int)dr["ID"];
            if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute"))
                right.DutyAttribute = dr["DutyAttribute"] as string;
            right.EmpID = Convert.ToInt32(dr["EmpID"]);
            if (!string.IsNullOrEmpty(dr["Status"].ToString())) right.Status = (bool)dr["Status"];
            if (!string.IsNullOrEmpty(dr["GeRenStatus"].ToString())) right.GeRenStatus = Convert.ToInt32(dr["GeRenStatus"]);
            right.PublicOfficialSelectionID = Convert.ToInt32(dr["PublicOfficialSelectionID"]);
            if (!string.IsNullOrEmpty(dr["Date"].ToString())) right.Date = (DateTime?)dr["Date"];
            right.Unit = dr["Unit"] as string;
            right.Department = dr["Department"] as string;
            right.Duty = dr["Duty"] as string;
            if (!string.IsNullOrEmpty(dr["PublicOfficialRecordID"].ToString())) right.PublicOfficialRecordID = Convert.ToInt32(dr["PublicOfficialRecordID"]);
            right.BaoMingCount = dr["BaoMingCount"].ToString();
            right.BaoMingCount1 = dr["BaoMingCount1"].ToString();
            right.DaiShenHeCount = dr["DaiShenHeCount"].ToString();
            right.EmpName = dr["EmpName"] as string;
            right.IsLocked = Convert.ToBoolean(dr["IsLocked"]);
            right.CardNo = dr["CardNo"] as string;
            right.NowUnit = dr["NowUnit"] as string;
            right.NowDuty = dr["NowDuty"] as string;
            right.CheckMemo = dr["CheckMemo"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("MianShiDiZhi"))
                right.MianShiDiZhi = dr["MianShiDiZhi"] as string;
            if (!string.IsNullOrEmpty(dr["BiShiScore"].ToString())) right.BiShiScore = Convert.ToDecimal(dr["BiShiScore"]);
            if (!string.IsNullOrEmpty(dr["MianShiScore"].ToString())) right.MianShiScore = Convert.ToDecimal(dr["MianShiScore"]);
            if (!string.IsNullOrEmpty(dr["TotalScore"].ToString())) right.TotalScore = Convert.ToDecimal(dr["TotalScore"]);
            if (!string.IsNullOrEmpty(dr["MingCi"].ToString())) right.MingCi = Convert.ToInt32(dr["MingCi"]);
            right.FaBuType = dr["FaBuType"] as string;
            right.IsTongYi = dr["IsTongYi"] as string;
            right.Zu = dr["Zu"] as string;
            right.MianShiRiQi = dr["RiQi"] as string;
            if (!string.IsNullOrEmpty(dr["BiShiFenZheSuan"].ToString())) right.BiShiFenZheSuan = Convert.ToDecimal(dr["BiShiFenZheSuan"]);
            if (!string.IsNullOrEmpty(dr["MianShiFenZheSuan"].ToString())) right.MianShiFenZheSuan = Convert.ToDecimal(dr["MianShiFenZheSuan"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Department_Duty"))
                right.Department_Duty = dr["Department_Duty"] as string;
            switch (right.GeRenStatus)
            {
                case 0:
                    right.CheckState = "未审核";
                    break;
                case 1:
                    right.CheckState = "已审核";
                    break;
                case 2:
                    right.CheckState = "已退回";
                    break;
                    break;
            }
            return right;
        }

        public static PublicOfficialRecordModel FillEntity2(DataRow dr)
        {
            PublicOfficialRecordModel right = new PublicOfficialRecordModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ExameID")) if (!string.IsNullOrEmpty(dr["ExameID"].ToString())) right.ExameID = Convert.ToInt32(dr["ExameID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (!string.IsNullOrEmpty(dr["XuQiuCount"].ToString())) right.XuQiuCount = Convert.ToInt32(dr["XuQiuCount"]);
            //if (!string.IsNullOrEmpty(dr["NiTongYiCount"].ToString())) right.NiTongYiCount = (int)dr["NiTongYiCount"];
            right.OrgName = dr["OrgName"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("MianShiDiZhi"))
                right.MianShiDiZhi = dr["MianShiDiZhi"] as string;
            if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute"))
                right.DutyAttribute = dr["DutyAttribute"] as string;
            if (!string.IsNullOrEmpty(dr["OrgID"].ToString())) right.OrgID = Convert.ToInt32(dr["OrgID"]);
            right.FaBuType = dr["FaBuType"] as string;
            right.IsLocked = Convert.ToBoolean(dr["IsLocked"]); if (dr.Table != null && dr.Table.Columns.Contains("Department_Duty"))
                right.Department_Duty = dr["Department_Duty"] as string;
            return right;
        }

        
    }
}
